package com.mydemo.design_pattern.action_type.strategy_pattern.demo1;

import com.mydemo.design_pattern.action_type.strategy_pattern.demo1.impl.OperationAdd;
import com.mydemo.design_pattern.action_type.strategy_pattern.demo1.impl.OperationSubstract;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: TestDemo, v1.0 2019-09-24 13:40 liming1 Exp $
 */
public class TestDemo {
    public static void main(String[] args) {
        OperatorContext context = new OperatorContext();
        context.setStrategy(new OperationAdd());
        context.doOpera(1, 2);

        context.setStrategy(new OperationSubstract());
        context.doOpera(2, 3);
    }
}
